package com.fan.txl.utils;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.google.android.flexbox.FlexDirection;
import com.google.android.flexbox.FlexboxLayoutManager;
import com.google.android.flexbox.JustifyContent;

/**
 * Created by jiajiabao on 17-1-10.
 */

public class RecyclerViewUtils {

    public static RecyclerView.LayoutManager getHLayMgr(Context context){
        RecyclerView.LayoutManager _lm = new LinearLayoutManager(context);
        return _lm;
    }

    /*mImageView.setImageDrawable(drawable);
    ViewGroup.LayoutParams lp = mImageView.getLayoutParams();
    if (lp instanceof FlexboxLayoutManager.LayoutParams) {
        FlexboxLayoutManager.LayoutParams flexboxLp = (FlexboxLayoutManager.LayoutParams)
                mImageView.getLayoutParams();
        flexboxLp.setFlexGrow(1.0f);
        flexboxLp.setAlignSelf(AlignSelf.FLEX_END);
    }
    */
    public static FlexboxLayoutManager getFlexMgr() {
        FlexboxLayoutManager flexboxLayoutManager = new FlexboxLayoutManager();
        FlexboxLayoutManager layoutManager = new FlexboxLayoutManager();
        layoutManager.setFlexDirection(FlexDirection.COLUMN);
        layoutManager.setJustifyContent(JustifyContent.FLEX_END);
        return flexboxLayoutManager;
    }
}
